home *** CD-ROM | disk | FTP | other *** search
- #include <string.h>
- #include <QuickDraw.h>
- #include "Flash.h"
-
- pascal void FlashMain(XCmdPtr paramPtr)
- {
- short again;
- long flashCount;
- Handle returnHdl;
- GrafPtr port;
- Str255 str, tempStr;
-
- // First param is flash count. Convert it to a pascal string
- returnHdl = NewHandle(256L);
- strcpy((char*)str, (char*)*(unsigned char **)paramPtr->params[0]);
- CtoPstr((char*)str);
-
- // Convert the string to a number
- StringToNum(str, &flashCount);
- PtoCstr((char*)str);
-
- // Invert the screen and sound the beep.
- GetPort(&port);
- for (again = 0; again < flashCount; again++)
- {
- InvertRect(&port->portRect);
- InvertRect(&port->portRect);
- SysBeep(5);
- }
-
- // Build the return string.
- strcpy((char*)tempStr, "The number of flashes was ");
- strcat((char*)tempStr, (char*)str);
- strcat((char*)tempStr, " ");
- strcat((char*)tempStr, (char*)"\r");
- strcpy((char*)*returnHdl, (char*)tempStr);
- paramPtr->returnValue = returnHdl;
- }
-
-